<div class="topic">
	<div class="fl">Nossa Galeria de fotos</div>
	<div class="clearB"></div>
</div>

<div class="p20" style="text-align: center">
<table cellspacing="0" cellpadding="0" id="ufb0yt_1" class="uiGrid fbPhotosGrid" border="1" align="center">
	<tbody>
		<tr valign="top">
			<td align="center">
				<?php if(!count($galerias)): ?>
				<h3>Nenhuma galeria cadastrada!</h3>
				<?php endif; ?>
				<?php foreach($galerias as $galeria): ?>
					<a href="<?php echo url_for('@galeriaShow?slug='. $galeria->getSlug()); ?>" title="<?php echo $galeria->getNmGaleria(); ?>">
					<div class="fl thumbs g">
						<div class="title"><?php echo $galeria->getNmGaleria(); ?></div>
						<?php 
							echo image_tag(
						    	'/uploads/thumb/'.$galeria->Midia[0]['nm_midia'],
								array(
						    		'absolute' 	=>true,
						    		'alt' 		=> $galeria->Midia[0]['ds_midia'],
						    		'width'		=> 140,
						    		'height'	=> 140,
									'class' => 'thumbs'
								)
							); 
						?>
					</div>
					</a>
				<?php endforeach; ?>
			</td>
		</tr>
	</tbody>
</table>

<br />
<a href="javascript:history.back(-1);">Voltar</a>
</div>


<script type="text/javascript">
/*
$(function(){
	$.getJSON('https://graph.facebook.com/me/albums?access_token=AAACEdEose0cBABqND7ZAPue8ZAUbUY7EwsvHFVfMAzTIGVBHnhF4h3qUxitrWmc0XnzCetgwtdcBTrvZCMEw8MZC0UXbwzgZBrWPXkzvEPg7IXmIjA5tU', function(data) {
		var items = [];
		var counter = 0;
	  	$.each(data.data, function(key, val) {
	  		if(val.name != 'Wall Photos'){
	    		items.push('<td id="' + key + '">'+val.name + '</td>');
	    		if(counter == 4)
	    		{
	    			$('<tr/>', {
	    		    	'class': 'my-new-list',
	    		    	html: items.join('')
	    		  	}).appendTo('.fbPhotosGrid tbody');

	    		  	counter=0;
	    		  	items = [];
	    		}
	    		counter++;
	  		}
	  	});
	
	  	$('<tr/>', {
	    	'class': 'my-new-list',
	    	html: items.join('')
	  	}).appendTo('.fbPhotosGrid tbody');
	});
});
*/
</script>
